^
(?:
	(?![^:@]+:[^:@/]*@)
	(?<protocol>[^:/?#.]+):
)?
(?://)?
(?:(?:
	(?<user>[^:@/?#]*)
	(?::(?<password>[^:@/?#]*))?
)?@)?
(?<host>[^:/?#]*)
(?::(?<port>\d*))?
(
	(?:/
		(?:[^?#]
			(?![^?#/]*\.[^?#/.]+(?:[?#]|$))
		)*/?
	)?
	[^?#/]*
)
(?:\?(?<query>[^#]*))?
(?:\#(?<fragment>.*))?
